package com.itheima.java.ai.langchin4j.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.java.ai.langchin4j.entity.Doctor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DoctorMapper extends BaseMapper<Doctor> {
    
    @Select("SELECT * FROM doctors WHERE department = #{department} AND is_active = true ORDER BY rating DESC")
    List<Doctor> findByDepartmentAndActive(String department);
    
    @Select("SELECT * FROM doctors WHERE is_active = true ORDER BY rating DESC")
    List<Doctor> findAllActive();
    
    @Select("SELECT DISTINCT department FROM doctors WHERE is_active = true ORDER BY department")
    List<String> findAllDepartments();
}